package hk.gov.ehr.controller;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/SystemMessage")
public class SystemMessageController {

	   
	   @RequestMapping("/getMessages")
	   public String getMessages(String msgKey) throws FileNotFoundException, IOException {
		   StringBuffer ret=new StringBuffer();
		   String filePath=SystemMessageController.class.getResource("/static/msg_2.json").getPath();
		   try(
				   FileReader fr=new FileReader(filePath);
				   BufferedReader br=new BufferedReader(fr);
		   ){
			   String line = null;  
		         
		         while((line=br.readLine())!=null){  
		        
		             ret.append(line);
		             
		          }
				 
		   }
		   return ret.toString();
	   }
	
}
